const { projects } = require('../store/')

exports.getProjects = async (key) => {
  if (!key) {
    return projects
  }
  let result = projects.find(item => {
    return item.key === key
  })
  if (result) {
    return result
  } else {
    return {}
  }
}

exports.deployParam = async (key) => {
  let result = projects.find(item => {
    return item.key === key
  })
  if (result) {
    return {
      command: result.command,
      androidAppPath: result.androidAppPath,
      iosAppPath: result.iosAppPath
    }
  } else {
    return {}
  }
}